package com.example.demo.impl;

import com.example.demo.Entity.UserInfo;
import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Logger;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.sql.Time;
import java.util.Date;
import java.util.Timer;


@RestController
@RequestMapping("/jar")
public class JarImpl {

    @RequestMapping(method = RequestMethod.POST)
    public UserInfo service(String args){
        Logger log = Logger.getLogger(JarImpl.class);
        BasicConfigurator.configure();
        log.info("This is a Jar2");
        Date date = new Date(System.currentTimeMillis());
        UserInfo userInfo = new UserInfo();
        userInfo.setName("John");
        userInfo.setDescription(date.toString());
        return userInfo;
    }
}
